


import 'package:bike_ride/api/common_repository.dart';
import 'package:bike_ride/common/mvvm/base_view_model.dart';
import 'package:bike_ride/common/util/account_manager.dart';
import 'package:bike_ride/common/widget/notifier_widget.dart';
import 'package:bike_ride/model/personal/view/personal_v.dart';
import 'package:dio/dio.dart';

class PersonalViewModel extends PageViewModel<PersonalViewState> {
  CancelToken? cancelToken;


  @override
  onCreate() {
    cancelToken = CancelToken();
    pageDataModel = PageDataModel();
    requestData();
  }

  @override
  onDispose() {
    if (!(cancelToken?.isCancelled ?? true)) {
      cancelToken?.cancel();
    }
    super.onDispose();
  }

  Future signOut()async{
    final result = await CommonRepository.signOutIdl(cancelToken: cancelToken);
    if(result){
      AccountManager.toLogin();
    }
  }
  /// 请求数据
  @override
  Future<PageViewModel?> requestData({Map<String, dynamic>? params}) async {
    return null;

  }
}